<template>
  <a-table :columns="columns" :data-source="dataSource" bordered :pagination="true">
    <template #bodyCell="{ column, text, record }">
      <template v-if="column.dataIndex === 'action'">
        <div>
          <span>
            <a-button type="link" @click="openDetail(record)">查看</a-button>
          </span>
        </div>
      </template>
    </template>
  </a-table>
</template>
<script setup>
import { cloneDeep } from 'lodash-es';
const props = defineProps({
  historyData: Array
})
const dataSource = ref(props.historyData);
const emit = defineEmits(["getDetail"])
const columns = [
  {
    title: "名称",
    dataIndex: "wellId",
    key: "wellId",
  },
  {
    title: "更新时间",
    dataIndex: "createdTime",
    key: "createdTime",
  },
  {
    title: "操作",
    dataIndex: "action",
    key: "action",
  },
];

function openDetail(obj) {
  emit('getDetail', obj)
}
</script>